package com.itheima.reggie.common;

public class BaseContext {
    private static ThreadLocal<Long> LOCAL = new ThreadLocal<>();
    /**
     * 存储数据
     * @param id
     */
    public static void setCurrentId(Long id){
        LOCAL.set(id);
    }

    /**
     * 存储数据
     */
    public static Long getCurrentId(){
        return LOCAL.get();
    }

    /**
     * 删除数据
     */
    public static void removeCurrentId(){
        LOCAL.remove();
    }

}
